const MAKEUP_TYPE = {
  LOOK: {
    type: 'Look',
    name: '主题妆容'
  },
  LIPSTICK: {
    type: 'lipstick',
    name: '唇彩'
  },
  BLUSH: {
    type: 'blush',
    name: '腮红'
  },
  MASCARA: {
    type: 'mascara',
    name: '睫毛膏'
  },
  EYELASHES: {
    type: 'eyelashes',
    name: '假睫毛'
  },
  EYE_SHADOW: {
    type: 'eye_shadow',
    name: '眼影'
  },
  EYE_LINE: {
    type: 'eye_line',
    name: '眼线'
  },
  SKIN_TONER: {
    type: 'skin_toner',
    name: '粉底'
  },
  EYE_CONTACT: {
    type: 'eye_contact',
    name: '隐形眼镜'
  }
}
const SCALE_TYPES = [
  { value: 'FIX_XY', name: 'FIX XY' },
  { value: 'CENTER_CROP', name: 'CENTER' },
  { value: 'CENTER_INSIDE', name: 'INSIDE' }
]
const FEATURE = {
  ZOOM_RATIO: {
    type: 'zoomRatio',
    name: '缩放',
    min: -50,
    max: 50
  },
  COMPARE_POSITION: {
    type: 'comparePosition',
    name: '比较位置',
    min: 1,
    max: 9
  },
  SKIN_SMOOTH: {
    type: 'skinSmooth',
    name: '光滑度',
    min: 0,
    max: 100
  },
  FACE_RESHAPE: {
    type: 'faceReshape',
    name: '瘦脸',
    min: -100,
    max: 100
  },
  ENLARGE_EYE: {
    type: 'enlargeEye',
    name: '大眼',
    min: -100,
    max: 100
  }
}
const ALL_MAKEUP_TYPES = Object.values(MAKEUP_TYPE)
const SUPPORT_LIST = [MAKEUP_TYPE.EYELASHES]
// const SUPPORT_LIST = [MAKEUP_TYPE.LOOK, MAKEUP_TYPE.LIPSTICK, MAKEUP_TYPE.EYE_CONTACT, MAKEUP_TYPE.EYE_SHADOW, MAKEUP_TYPE.EYE_LINE, MAKEUP_TYPE.BLUSH, MAKEUP_TYPE.MASCARA, MAKEUP_TYPE.SKIN_TONER]
const SUPPORT_INTENSITY_LIST = [MAKEUP_TYPE.LIPSTICK, MAKEUP_TYPE.BLUSH, MAKEUP_TYPE.SKIN_TONER, FEATURE.SKIN_SMOOTH, FEATURE.FACE_RESHAPE, FEATURE.ENLARGE_EYE]
const SUPPORT_FEATURE_LIST = [FEATURE.SKIN_SMOOTH, FEATURE.FACE_RESHAPE, FEATURE.ENLARGE_EYE, FEATURE.ZOOM_RATIO, FEATURE.COMPARE_POSITION]

function initTypesMap(initValue, skuTypeList = SUPPORT_LIST) {
  const types = skuTypeList.map(obj => obj.type)
  const map = {}
  types.forEach(type => (map[type] = initValue))
  return map
}

module.exports = {
  ALL_MAKEUP_TYPES,
  SUPPORT_LIST,
  SUPPORT_INTENSITY_LIST,
  FEATURE,
  SUPPORT_FEATURE_LIST,
  SCALE_TYPES,
  initTypesMap
}
